Fix getdomaininfo for vmx guests.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 11 Aug 2005 21:19:45 +0000 (21:19 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 11 Aug 2005 21:19:45 +0000 (21:19 +0000)
Replaces Intel patch [14/15].
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/dom0_ops.c

index b933cbdfaae0b2519c0399e0fde4cca2e15d98e5..01ea09b74e7c0352a50b61270a024ccbdd0ff411 100644 (file)
@@ -404,16 +404,18 @@ void arch_getdomaininfo_ctxt(
 
     memcpy(c, &v->arch.guest_context, sizeof(*c));
 
-    /* IOPL privileges are virtualised -- merge back into returned eflags. */
-    BUG_ON((c->user_regs.eflags & EF_IOPL) != 0);
-    c->user_regs.eflags |= v->arch.iopl << 12;
-
     if ( VMX_DOMAIN(v) )
     {
         save_vmx_cpu_user_regs(&c->user_regs);
         __vmread(CR0_READ_SHADOW, &c->ctrlreg[0]);
         __vmread(CR4_READ_SHADOW, &c->ctrlreg[4]);
     }
+    else
+    {
+        /* IOPL privileges are virtualised: merge back into returned eflags. */
+        BUG_ON((c->user_regs.eflags & EF_IOPL) != 0);
+        c->user_regs.eflags |= v->arch.iopl << 12;
+    }
 
     c->flags = 0;
     if ( test_bit(_VCPUF_fpu_initialised, &v->vcpu_flags) )